package com.googlecode.openldap2fedorads;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
 * 
 * @author Soseh
 * Converts openldap schema to Fedora DS schema.
 */
public class SchemaConverter {

	public String filter(String s) {
		s = s.replace("attributetype ", "attributeTypes:");
		s = s.replace("objectclass ", "objectClasses:");
		s = s.replace(":(", ":( \n");
		return s;
	}

	public void processStream(InputStream in) throws IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(in));
		String s = r.readLine();
		while(s != null){
			System.out.println(filter(s));
			s = r.readLine();			
		}
	}

}
